package TestDay;

import java.util.Scanner;
public class Test03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int r = sc.nextInt();
        int[] arr1 = {12, 14, 23, 45, 66, 68, 70, 77, 90, 91};
        int[] arr2 = new int[11];
//        定义变量插入的位置：
        int idex = 0;
        for (int x = 0; x < arr1.length; x++) {
            if (arr1[x] <= r) {
                arr2[x] = arr1[x];
                idex = x + 1;
            } else {
                arr2[x+1] = arr1[x];
            }
        }
        arr2[idex]=r;
        System.out.println("生成的新数组是："+arr2);
        for (int i = 0; i <arr2.length ; i++) {
            System.out.print(arr2[i]+" ");

        }
    }
}
